

//
//  LJHListTableViewCell.m
//  HEARME
//
//  Created by liujinhui on 16/1/23.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LJHListTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "LJHTopFirstKResultsModel.h"
@interface LJHListTableViewCell ()

@property(nonatomic,retain)UIImageView *listIma;
@property(nonatomic,retain)UIImageView *imaMore;
@property(nonatomic,retain)UILabel *topLable;
@property(nonatomic,retain)UILabel *topOneLable;
@property(nonatomic,retain)UILabel *topTwoLable;

@end

@implementation LJHListTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createCell];
    }
    return self;
}

-(void)createCell
{
    self.listIma = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, WIDTH/4.5, WIDTH/4.6)];
    [self.contentView addSubview:self.listIma];
    self.listIma.backgroundColor = [UIColor redColor];
    
    self.topLable = [[UILabel alloc]initWithFrame:CGRectMake(15+WIDTH/4.5, 15, WIDTH-50-15-WIDTH/4.5, HEIGHT/7/4)];
//        self.topLable.backgroundColor = [UIColor colorWithRed:0.817 green:1.000 blue:0.982 alpha:1.000];
    [self.contentView addSubview:self.topLable];
    
    self.topOneLable = [[UILabel alloc]initWithFrame:CGRectMake(20+15+WIDTH/4.5, 15+HEIGHT/7/4, WIDTH-50-15-WIDTH/4.5-20, HEIGHT/7/4)];
//        self.topOneLable.backgroundColor = [UIColor colorWithRed:1.000 green:0.978 blue:0.776 alpha:1.000];
    [self.contentView addSubview:self.topOneLable];
    
    self.topTwoLable = [[UILabel alloc]initWithFrame:CGRectMake(20+15+WIDTH/4.5, 15+HEIGHT/7/4*2, WIDTH-50-15-WIDTH/4.5-20, HEIGHT/7/4)];
//        self.topTwoLable.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:self.topTwoLable];
    
    self.imaMore = [[UIImageView alloc]initWithFrame:CGRectMake(WIDTH-30, (15+HEIGHT/7)/2.8, 20, 20)];
    self.imaMore.image = [UIImage imageNamed:@"cell_arrow@2x.png"];
    [self.contentView addSubview:self.imaMore];
    
    UILabel *lableF = [[UILabel alloc]initWithFrame:CGRectMake(20+WIDTH/4.5, 15+HEIGHT/7/4+10, 15, 15)];
    lableF.text = @"1";
    lableF.textColor = [UIColor grayColor];
    lableF.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:lableF];
    
    UILabel *lableT = [[UILabel alloc]initWithFrame:CGRectMake(20+WIDTH/4.5, 15+HEIGHT/7/4*2+10, 15, 15)];
    lableT.text = @"2";
    lableT.textColor = [UIColor grayColor];
    lableT.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:lableT];
    
}
-(void)setTopModel:(LJHTopModel *)topModel
{
    if (_topModel!=topModel) {
        [_topModel release];
        _topModel = [topModel retain];
    }
    self.topLable.text = _topModel.title;
    NSURL *url = [NSURL URLWithString:_topModel.coverPath];
    [self.listIma sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"1024.jpg"]];

    self.topOneLable.text = _topModel.firstTitle;
    
}
-(void)setArrFirst:(NSMutableArray *)arrFirst
{
    if (_arrFirst!=arrFirst) {
        [_arrFirst release];
        _arrFirst = [arrFirst retain];
    }
    LJHTopFirstKResultsModel *fModel = [_arrFirst objectAtIndex:1];
        self.topTwoLable.text = fModel.title;
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
